Optimal. Leaf size=52 \[ -b x+\frac {a \tanh ^{-1}(\cos (c+d x))}{2 d}-\frac {b \cot (c+d x)}{d}-\frac {a \cot (c+d x) \csc (c+d x)}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 52, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {2917, 2691,
3855, 3554, 8} \begin {gather*} \frac {a \tanh ^{-1}(\cos (c+d x))}{2 d}-\frac {a \cot (c+d x) \csc (c+d x)}{2 d}-\frac {b \cot (c+d x)}{d}-b x \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2691
Rule 2917
Rule 3554
Rule 3855
Rubi steps
\begin {align*} \int \cot ^2(c+d x) \csc (c+d x) (a+b \sin (c+d x)) \, dx &=a \int \cot ^2(c+d x) \csc (c+d x) \, dx+b \int \cot ^2(c+d x) \, dx\\ &=-\frac {b \cot (c+d x)}{d}-\frac {a \cot (c+d x) \csc (c+d x)}{2 d}-\frac {1}{2} a \int \csc (c+d x) \, dx-b \int 1 \, dx\\ &=-b x+\frac {a \tanh ^{-1}(\cos (c+d x))}{2 d}-\frac {b \cot (c+d x)}{d}-\frac {a \cot (c+d x) \csc (c+d x)}{2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains higher order function than in optimal. Order 5 vs. order 3 in
optimal.
time = 0.04, size = 109, normalized size = 2.10 \begin {gather*} -\frac {a \csc ^2\left (\frac {1}{2} (c+d x)\right )}{8 d}-\frac {b \cot (c+d x) \, _2F_1\left (-\frac {1}{2},1;\frac {1}{2};-\tan ^2(c+d x)\right )}{d}+\frac {a \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )}{2 d}-\frac {a \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )}{2 d}+\frac {a \sec ^2\left (\frac {1}{2} (c+d x)\right )}{8 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.13, size = 71, normalized size = 1.37
method | result | size |
derivativedivides | \(\frac {a \left (-\frac {\cos ^{3}\left (d x +c \right )}{2 \sin \left (d x +c \right )^{2}}-\frac {\cos \left (d x +c \right )}{2}-\frac {\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{2}\right )+b \left (-\cot \left (d x +c \right )-d x -c \right )}{d}\) | \(71\) |
default | \(\frac {a \left (-\frac {\cos ^{3}\left (d x +c \right )}{2 \sin \left (d x +c \right )^{2}}-\frac {\cos \left (d x +c \right )}{2}-\frac {\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{2}\right )+b \left (-\cot \left (d x +c \right )-d x -c \right )}{d}\) | \(71\) |
risch | \(-b x -\frac {i \left (i a \,{\mathrm e}^{3 i \left (d x +c \right )}+i a \,{\mathrm e}^{i \left (d x +c \right )}+2 b \,{\mathrm e}^{2 i \left (d x +c \right )}-2 b \right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{2}}+\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{2 d}-\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{2 d}\) | \(103\) |
norman | \(\frac {-\frac {a}{8 d}+\frac {a \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 d}-\frac {b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2 d}+\frac {b \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d}-b x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-b x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {a \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}-\frac {a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d}\) | \(148\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.50, size = 66, normalized size = 1.27 \begin {gather*} -\frac {4 \, {\left (d x + c + \frac {1}{\tan \left (d x + c\right )}\right )} b - a {\left (\frac {2 \, \cos \left (d x + c\right )}{\cos \left (d x + c\right )^{2} - 1} + \log \left (\cos \left (d x + c\right ) + 1\right ) - \log \left (\cos \left (d x + c\right ) - 1\right )\right )}}{4 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 114 vs.
\(2 (48) = 96\).
time = 0.39, size = 114, normalized size = 2.19 \begin {gather*} -\frac {4 \, b d x \cos \left (d x + c\right )^{2} - 4 \, b d x - 4 \, b \cos \left (d x + c\right ) \sin \left (d x + c\right ) - 2 \, a \cos \left (d x + c\right ) - {\left (a \cos \left (d x + c\right )^{2} - a\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + {\left (a \cos \left (d x + c\right )^{2} - a\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right )}{4 \, {\left (d \cos \left (d x + c\right )^{2} - d\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \sin {\left (c + d x \right )}\right ) \cos ^{2}{\left (c + d x \right )} \csc ^{3}{\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.45, size = 95, normalized size = 1.83 \begin {gather*} \frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 8 \, {\left (d x + c\right )} b - 4 \, a \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) + 4 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + \frac {6 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 4 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - a}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2}}}{8 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 9.36, size = 151, normalized size = 2.90 \begin {gather*} \frac {b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,d}-\frac {b\,\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,d}-\frac {a\,\ln \left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{2\,d}-\frac {2\,b\,\mathrm {atan}\left (\frac {2\,b\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )+a\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{a\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )-2\,b\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}-\frac {a\,{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{8\,d}+\frac {a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{8\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________